#ifndef SEU_LIST_H
#define SEU_LIST_H
#include"include.h"

typedef struct node_type
{
   void *data;
   struct node_type *next;
} node_t;

typedef struct list_type
{
   node_t *front;
   node_t *back;
   node_t *current;
   int size;
   sem_t lock;
} list_t;

list_t *createList();
void addObject(list_t *list, void *objPtr); 
void resetList(list_t *list);               
void *getObject(list_t *list);
void *listPopBack(list_t *list);
void *removeObject(list_t *list, void *obj);
int  endList(list_t *list);
int listIsEmpty(list_t *list);
unsigned int listGetSize(list_t *l);
void sortList(list_t *p, int (*compare)(const void *, const void *));
void clearList(list_t *list);
void clearListAndFreeElements(list_t *list);
void clearListAndFreeElementsNP(list_t *list); // Doesn't free the list itself

void listPrintPointers(list_t *l);
void listLock(list_t *list);
void listRelease(list_t *list);
int listIsLocked(list_t *list);

#endif
